<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST">
    <div class="form-group">
        {if($supplier)}
        <!-- 供应商 -->
        <label class="control-label col-xs-12 col-sm-1">{:__('Supplierid')}:</label>
        <div class="col-xs-12 col-sm-2">
            <input id="c-supplierid" min="0" class="form-control" type="text" placeholder="{:__('Supplierid')}"
                value="{$supplier.name|htmlentities}">
            <input type="hidden" name="row[supplierid]" id="supplierid">
        </div>

        <label class="control-label col-xs-12 col-sm-1">{:__('Mobile')}:</label>
        <div class="col-xs-12 col-sm-2">
            <input id="c-mobile" type="text" class="form-control" name="row[mobile]" placeholder="{:__('Mobile')}"
                value="{$supplier.mobile|htmlentities}" />
        </div>

        <label class="control-label col-xs-12 col-sm-1">{:__('Region')}:</label>
        <div class="col-xs-12 col-sm-3">
            <div class='control-relative'>
                <input id="c-Region" class="form-control" data-toggle="city-picker" type="text"
                    value="{$supplier.districts.code|htmlentities}">
            </div>
        </div>
        <!-- <label class="control-label col-xs-12 col-sm-1">{:__('Address')}:</label> -->
        <div class="col-xs-12 col-sm-2">
            <input id="c-address" type="text" class="form-control" name="row[address]" placeholder="{:__('Address')}"
                value="{$supplier.address}" />
        </div>
        {else /}
        <label class="control-label col-xs-12 col-sm-1">订单号</label>
        <div class="col-xs-12 col-sm-2">
            <input type="text" class="form-control" value="{$back.ordercode|htmlentities}" disabled>
        </div>

        <label class="control-label col-xs-12 col-sm-1">退货单号</label>
        <div class="col-xs-12 col-sm-2">
            <input type="text" class="form-control" value="{$back.code|htmlentities}" disabled>
        </div>

        <label class="control-label col-xs-12 col-sm-1">客户</label>
        <div class="col-xs-12 col-sm-2">
            <input type="text" class="form-control" value="{$back.business.nickname|htmlentities}" disabled>
        </div>
        {/if}
        <!-- 商品数据 -->
        <input type="hidden" name="row[product]" id="products">

        <!-- 商品总价 -->
        <input type="hidden" name="row[total]" id="total">

        <!-- 删除商品的id -->
        <input type="hidden" name="row[delproid]" id="delproid">
    </div>
    {if !$supplier}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">联系人及地址</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" value="联系人：{$back.contact|htmlentities} 手机号：{$back.phone|htmlentities} 地址：{$back.province_text|htmlentities}-{$back.city_text|htmlentities}-{$back.district_text|htmlentities} {$back.address|htmlentities}" disabled>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <!-- 入库类型 -->
        <label class="control-label col-xs-12 col-sm-1">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-2">
            <select id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.type|htmlentities" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <!-- 评论 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control " rows="5" name="row[remark]"
                cols="50">{$row.remark|htmlentities}</textarea>
        </div>
    </div>
    <!-- 添加商品 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-1">
            <button type="button" class="btn btn-primary" id="product">添加商品</button>
        </label>
    </div>
    <!-- 表格 -->
    <div class="form-group">
        <table id="table" class="table table-striped table-bordered table-hover table-nowrap col-sm-10 control-label">
        </table>
    </div>

    <div class="form-group hidden layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<style>
    .region_city .city-picker-span {
        width: 80% !important;
    }
</style>